<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>json1.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript" src="jquery-1.6.js"></script>
	<script type="text/javascript">
		function json1(){
			var sj={"name":"刘栩生","age":12};
			alert("姓名:"+sj.name+"  年龄："+sj.age);
		}
		function json2(){
			var sj={"name":"刘栩生","hobby":['aa','bb']};
			alert("爱好个数："+sj.hobby.length);
			alert("姓名:"+sj.name+"  爱好："+sj.hobby[1]);
		}
		function json3(){
			var sj={"name":"刘栩生","addr":{"city":"广州","street":"天河","postcode":"511111"}};

			alert("姓名:"+sj.name+"  地址："+sj.addr.city);
			alert("姓名:"+sj.name+"  地址："+sj['addr'].city);

			$.each(sj.addr,function(k,v){
				alert(sj.addr[k]);
				alert(v);
			});
		}
	</script>
  </head>
  
  <body>
    This is my HTML page. <br>
    <button onclick="json1()">json1</button>
    <button onclick="json2()">json2</button>
     <button onclick="json3()">json3</button>
  </body>
</html>
